<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>拖拽</title>
</head>
<style>
.box{
  width: 100px;
  height: 100px;
  background: red;
  position: absolute;
}
</style>
<body>
<div class="box" id="box">

</div>
<script src="drag.js"></script>
<script>
var drag = new DragFun('box')
</script>
</script>
</body>
</html>